package com.example.myapplication.found;

import com.example.myapplication.found.bean.BuyPointBean;
import com.example.myapplication.found.bean.KDJBean;
import com.example.myapplication.found.bean.KDJOrderBean;
import com.example.myapplication.found.bean.StockBean;
import com.example.myapplication.found.bean.StockKlineBean;
import com.example.myapplication.found.bean.StockOrderBean;
import com.example.myapplication.found.bean.ZhangDieBean;
import com.example.myapplication.found.contract.KdjCallback;
import com.example.myapplication.found.contract.PointCallback;
import com.example.myapplication.found.contract.SimpleCallback;
import com.example.myapplication.found.contract.ZhangDieCallback;
import com.example.myapplication.found.file.FoundDayJsonFile;
import com.example.myapplication.found.model.ChengJiaoLiang;
import com.example.myapplication.found.model.Fenxi;
import com.example.myapplication.found.model.KDJ;
import com.example.myapplication.found.model.Point;
import com.example.myapplication.found.model.ZhangDie;
import com.example.myapplication.shortvideo.utils.GsonUtil;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * @author: rongfeng
 * @date: 2022/2/10
 * @description
 */
public class Stock2 extends Stock {
    public String date;

    public Stock2(String fundCode, String fundName, String market) {
        super(fundCode, fundName, market);
    }


    @Override
    public void fenxi() {
        KDJ kdj = new KDJ(dayStockBean, weekStockBean);
        kdj.index = 99999999;
        kdj.setKdjCallback(new KdjCallback() {
            @Override
            public void kdjCallback(KDJOrderBean kdjOrderBean, BuyPointBean buyPointBean) {
                if (simpleCallback != null) {
                    simpleCallback.kdjCallback(kdjOrderBean, buyPointBean);
                }
            }
        });
        KDJBean kdjBean = kdj.getKDJ(date);
        if (kdjBean != null) {
            kdj.dayDeal(kdjBean);
        } else {
            if (simpleCallback != null) {
                simpleCallback.kdjCallback(null, null);
            }
        }
    }
}
